import java.util.Arrays;

public class Test {
    public static void main(String[] args) {
        MySort mySort = new MySort();
        for (int i = mySort.arr2.length/2; i > 1 ; i/=2) {
            mySort.shellSort(i);
        }
        mySort.shellSort(1);
        System.out.println(Arrays.toString(mySort.arr2));
    }
    public static void main12(String[] args) {
        MySort mySort = new MySort();
        mySort.createArr();
        System.out.println(Arrays.toString(mySort.arr4));
        mySort.noRecursion();
        System.out.println(Arrays.toString(mySort.arr4));
    }
    public static void main11(String[] args) {
        MySort mySort = new MySort();
        mySort.createArr();
        System.out.println(Arrays.toString(mySort.arr4));
        mySort.mergeSort();
        System.out.println(Arrays.toString(mySort.arr4));
    }
    public static void main10(String[] args) {
        MySort mySort = new MySort();
        long startTime = System.currentTimeMillis();
        mySort.noSort();
        long endTime = System.currentTimeMillis();
        System.out.println(endTime-startTime);
    }
    public static void main9(String[] args) {
        MySort mySort = new MySort();
        mySort.createArr();
        mySort.pointerSort4(mySort.arr4,0,mySort.arr4.length-1);

    }
    public static void main8(String[] args) {
        MySort mySort = new MySort();
        System.out.println(Arrays.toString(mySort.arr3));
        mySort.pointerSort(mySort.arr3,0,mySort.arr3.length-1);
        System.out.println(Arrays.toString(mySort.arr3));
    }

    public static void main7(String[] args) {
        MySort mySort = new MySort();
        System.out.println(Arrays.toString(mySort.arr3));
        mySort.digQuickSort(mySort.arr3,0,mySort.arr3.length-1);
        System.out.println(Arrays.toString(mySort.arr3));
    }
    public static void main6(String[] args) {
        MySort mySort = new MySort();
        mySort.quickSort(mySort.arr3,0,mySort.arr3.length-1);
        System.out.println(Arrays.toString(mySort.arr3));
    }

    public static void main5(String[] args) {
        HeapOrder heapOrder = new HeapOrder();
        HeapOrder.Node node = heapOrder.create();
        heapOrder.puDis(node);
    }

    public static void main4(String[] args) {
        MySort mySort = new MySort();
        mySort.createTree();
        System.out.println(Arrays.toString(mySort.arr3));
        mySort.puPrint();
        System.out.println(Arrays.toString(mySort.arr3));
    }
    public static void main3(String[] args) {
        MySort mySort = new MySort();
        System.out.println(Arrays.toString(mySort.arr3));
        mySort.selectSort();
        System.out.println(Arrays.toString(mySort.arr3));
        mySort.selectSort2();
        System.out.println(Arrays.toString(mySort.arr3));
    }

    public static void main2(String[] args) {
        MySort mySort = new MySort();
        long startTime = System.currentTimeMillis();
        for (int i = mySort.arr2.length/2; i > 1 ; i/=2) {
            mySort.shellSort(i);
        }
        mySort.shellSort(1);
        long endTime = System.currentTimeMillis();
        System.out.println(startTime-endTime);

        MySort mySort2 = new MySort();
        startTime = System.currentTimeMillis();
        mySort2.insertSort2();
        endTime = System.currentTimeMillis();
        System.out.println(startTime-endTime);
    }
    
    public static void main1(String[] args) {
        MySort mySort = new MySort();
        mySort.insertSort(2);
        System.out.println(Arrays.toString(mySort.arr));
        mySort.insertSort(4);
        System.out.println(Arrays.toString(mySort.arr));
        mySort.insertSort2();
        System.out.println(Arrays.toString(mySort.arr2));
    }
}
